<h3><?php echo $title; ?></h3>
<!--<div class="search_control">

<?php
$lang = $this->session->userdata("lang");
$lang = "vi";
/*	echo form_open('admin/product/cate_search');

  //search field

  $data = array('name' => 'search', 'value' => '', 'id' => 'search');	

  echo form_submit($data);

  $data = array('name' => 'keyword', 'value' => '', 'class' => 'keyword');

  echo form_input($data);



  //Type

  $options = array(

		'id' => 'ID',

		'first_name' => 'First Name',

    'full_name' => 'Full Name',

	);

	echo form_dropdown('search_type', $options);

	echo form_close();
*/
?>

</div><!--search_control end-->
<?php echo form_open('admin/advertisement/request'); ?>

<div class="control1">

<?php

	//add button

  echo link_image('admin/advertisement/create', 'images/admin/button_add.png');

  

  //delete button

  $data = array('name' => 'delete', 'value' => '', 'id' => 'delete');

  echo form_submit($data);

 

  //show field

  $data = array('name' => 'show', 'value' => '', 'id' => 'show');	

  echo form_submit($data);
//$_SESSION['row_number']
  $data = array('name' => 'row_number', 'value' => $_SESSION['row_number'], 'id' => 'show_number');	

  echo form_input($data);

?>

</div><!--control1 end <script language="javascript">
$(document).ready(function(){
	var a =$('input:checkbox[name="all"]').is(':checked') ;
	$('input:checkbox[name="all"]').click(function()
	{
		var a =$(this).is(':checked') ;
		if(a == true)
			$('input:checkbox[name="select_id[]"]').attr('checked',true);
		else
			$('input:checkbox[name="select_id[]"]').attr('checked',false);
	});

});


</script>-->

<table class="default" style="">

<?php

	if (is_array($result) )

	{

		//title

		echo '<tr >';

		echo '<th width="50" >';
			echo '&nbsp;',form_checkbox('all'),'&nbsp;All';
		echo '</th>';

//    echo '<th width="70">Active</th>';'select_id[]'

//    echo '<th width="90">STT</th>';
		  echo '<th width="100"> Tên Quảng Cáo</th>';
		echo '<th width="90">'.$this->lang->line('image').'</th>';
			echo '<th width="150">'.$this->lang->line('product_detail').'</th>';
			echo '<th width="90">Ngày hết hạn</th>';
				echo '<th width="90">Loại Quảng cáo</th>';
					echo '<th width="90">Vị trí</th>';	
		echo '<th width="50">Trạng thái</th>';
//		echo '<th width="50">'.$this->lang->line('new_product').'</th>';
		//echo '<th width="100">Info</th>';

		echo '</tr>';

		

		//print

		foreach ($result as $row)

		{

			echo '<tr>';



			//action

			echo '<td>';

			echo form_checkbox('select_id[]', $row['id']);

			echo '&nbsp;';

			echo anchor('admin/advertisement/update/'.$row['id'], 'Edit');

			echo '</td>';



   


$name = unserialize($row['name']);
     
//Mã SP
	
			echo '<td>';

      //echo $code[$lang];
	 echo  $name[$lang];
			echo '</td>';

      // hinh ảnh

			echo '<td>';

    echo "<img src='".site_link_img("upload/ads/".$row['image'])."' width='100' height='100' />";

			echo '</td>';
			
	// MO TA
			
			echo '<td>';
$info = unserialize($row['info']);
    echo "<div class='scroll'>".html_entity_decode($info[$lang],ENT_QUOTES,"UTF-8")."</div>";

			echo '</td>';


	/// ngay het han
		echo '<td>';

    	 

			echo '</td>';
	
			// Loai quang cao

		echo '<td>';

	echo ($row["type"] == 1 )? "Form" : "Logo" ;
		 echo '</td>';

// vi tri
		echo '<td>';
			echo ucfirst($row["position"]);
		 echo '</td>';
// trang thai
		echo '<td>';
	echo  ($row["actived"] == 1 )? "<input type='checkbox' checked='true' disabled='disabled' /> " : "<input type='checkbox' checked='true' disabled='disabled' /> " ;
	
			 echo '</td>';


			echo '</tr>';

		}

	}

	else

	{

		echo 'Data does not exist';

	}

?>

</table><!--end main content-->



<?php

	echo form_close(); //FORM END

	

	//page
	
	echo '<div class="page">'.$page.'</div>';

?>